package r4.pierwszy.raz;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Daty {

	public static void main(String[] args) {

		Date dzis = new Date();
		System.out.println(dzis.toString());
		
		Date birthday;
		birthday = null;
		System.out.println(birthday);
		
		GregorianCalendar urodzilemSie = new GregorianCalendar(1970, Calendar.JANUARY, 9);
		GregorianCalendar sylwester1999 = new GregorianCalendar(1999, Calendar.DECEMBER, 31, 23, 59, 59);
		Date birtDate = urodzilemSie.getTime();
		System.out.println(birtDate);
		System.out.println(urodzilemSie);
		int rok = sylwester1999.get(Calendar.YEAR);
		int miesiac = sylwester1999.get(Calendar.MONTH);
		int dzien = sylwester1999.get(Calendar.DAY_OF_MONTH);
		int dzienTygodnia = sylwester1999.get(Calendar.DAY_OF_WEEK);
		
		System.out.printf("%4d %2d %2d %s\n", rok, miesiac, dzien, dzienTygodnia);
		
		
	}

}
